package com.jp.security.controller;

import com.jp.security.entity.User;
import com.jp.security.service.SysLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class TokenController {

    @Autowired
    private SysLoginService sysLoginService;

    @PostMapping("/login")
    public Object login(@RequestBody User user){
        Map<String,Object> map = sysLoginService.login(user);
        // todo 封装返回类型
        return "登录成功";
    }

}
